<html>
<head><meta charset="utf-8"><title>Raw reference macros · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html">Raw reference macros</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197988038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197988038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197988038">(May 18 2020 at 19:59)</a>:</h4>
<p>Unbeknownst to me, <span class="user-mention silent" data-user-id="120791">RalfJ</span> had already opened <a href="https://github.com/rust-lang/rust/issues/72279">#72279</a>, which exposes two unstable macros, <code>raw_ref</code> and <code>raw_ref_mut</code> at the top level. They expand to the unstable <code>&amp;raw const</code> and <code>&amp;raw mut</code> syntax. I think any discussion of the specifics can occur on that PR.</p>



<a name="197997595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197997595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197997595">(May 18 2020 at 21:26)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> <span class="user-mention" data-user-id="120791">@RalfJ</span> I was going to make an fcp merge, but I was wondering what you two think of <a href="https://gist.github.com/nikomatsakis/2fd9d3f1eeede256aa7c17b3d4af1376">this write-up</a>?</p>



<a name="197997599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197997599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197997599">(May 18 2020 at 21:26)</a>:</h4>
<p>Does it capture the key concerns?</p>



<a name="197998310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197998310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197998310">(May 18 2020 at 21:33)</a>:</h4>
<p>Looks good to me! What's up with the casing of "CAPABILITIES"?</p>



<a name="197998855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197998855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197998855">(May 18 2020 at 21:39)</a>:</h4>
<p>heh I don't know</p>



<a name="197998866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197998866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197998866">(May 18 2020 at 21:39)</a>:</h4>
<p>emphasis</p>



<a name="197998878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/197998878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#197998878">(May 18 2020 at 21:39)</a>:</h4>
<p>doesn't seem necessary :)</p>



<a name="198032850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198032850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198032850">(May 19 2020 at 08:02)</a>:</h4>
<p><span class="user-mention" data-user-id="118594">@ecstatic-morse</span> sorry if I stepped on your toes here, I wasn't aware you had plans in this area.</p>



<a name="198032874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198032874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198032874">(May 19 2020 at 08:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> re: your write-up</p>
<blockquote>
<p>"and that is not UB"</p>
</blockquote>
<p><em>until the pointer is actually dereferenced</em></p>



<a name="198088485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198088485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198088485">(May 19 2020 at 16:04)</a>:</h4>
<p>Nothing like that. My action item from the meeting was to ask <span class="user-mention" data-user-id="120791">@RalfJ</span>  to open this exact PR.</p>



<a name="198140268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198140268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198140268">(May 19 2020 at 23:32)</a>:</h4>
<p>did a rfcbot fcp merge, so <span class="user-group-mention" data-user-group-id="1977">@T-lang</span> members should go check it out :)</p>



<a name="198140396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198140396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198140396">(May 19 2020 at 23:34)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="198140400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198140400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198140400">(May 19 2020 at 23:34)</a>:</h4>
<p>I hope to see an <code>offsetof!</code> based on these, once they're available. :)</p>



<a name="198160207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198160207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198160207">(May 20 2020 at 06:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="118594">ecstatic-morse</span> <a href="#narrow/stream/213817-t-lang/topic/Raw.20reference.20macros/near/198088485">said</a>:</p>
<blockquote>
<p>Nothing like that. My action item from the meeting was to ask <span class="user-mention silent" data-user-id="120791">RalfJ</span>  to open this exact PR.</p>
</blockquote>
<p>ah, I clearly foresaw that then :D</p>



<a name="198160220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198160220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198160220">(May 20 2020 at 06:49)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/213817-t-lang/topic/Raw.20reference.20macros/near/198140400">said</a>:</p>
<blockquote>
<p>I hope to see an <code>offsetof!</code> based on these, once they're available. :)</p>
</blockquote>
<p>I'll adjust the <code>memoffset</code> crate once this is stable. Or do you mean in libcore?</p>



<a name="198161509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/Raw%20reference%20macros/near/198161509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/Raw.20reference.20macros.html#198161509">(May 20 2020 at 07:08)</a>:</h4>
<p>I'd like to see it in core eventually, but in the short term, I'd just like to see a version of offsetof with no UB.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>